PulseCanvas / app · pulsecanvas.ai / Sources / PulseCanvas / Resources / ProjectM / Presets / Reaction / Liquid Ripples / Flexi - alien web bouncer [23].milk
| 1 | MILKDROP_PRESET_VERSION=201 |
| 2 | PSVERSION=3 |
| 3 | PSVERSION_WARP=2 |
| 4 | PSVERSION_COMP=3 |
| 5 | [preset00] |
| 6 | fRating=5.000000 |
| 7 | fGammaAdj=1.000 |
| 8 | fDecay=0.995 |
| 9 | fVideoEchoZoom=1.007 |
| 10 | fVideoEchoAlpha=0.000 |
| 11 | nVideoEchoOrientation=3 |
| 12 | nWaveMode=0 |
| 13 | bAdditiveWaves=1 |
| 14 | bWaveDots=0 |
| 15 | bWaveThick=0 |
| 16 | bModWaveAlphaByVolume=1 |
| 17 | bMaximizeWaveColor=0 |
| 18 | bTexWrap=0 |
| 19 | bDarkenCenter=0 |
| 20 | bRedBlueStereo=0 |
| 21 | bBrighten=0 |
| 22 | bDarken=0 |
| 23 | bSolarize=0 |
| 24 | bInvert=0 |
| 25 | fWaveAlpha=1.413 |
| 26 | fWaveScale=0.418 |
| 27 | fWaveSmoothing=0.000 |
| 28 | fWaveParam=-0.660 |
| 29 | fModWaveAlphaStart=2.000 |
| 30 | fModWaveAlphaEnd=2.000 |
| 31 | fWarpAnimSpeed=0.190 |
| 32 | fWarpScale=3.070 |
| 33 | fZoomExponent=1.00001 |
| 34 | fShader=0.000 |
| 35 | zoom=0.99951 |
| 36 | rot=0.00000 |
| 37 | cx=0.500 |
| 38 | cy=0.500 |
| 39 | dx=0.00000 |
| 40 | dy=0.00000 |
| 41 | warp=0.04026 |
| 42 | sx=1.00000 |
| 43 | sy=1.00000 |
| 44 | wave_r=0.000 |
| 45 | wave_g=0.000 |
| 46 | wave_b=1.000 |
| 47 | wave_x=0.240 |
| 48 | wave_y=0.440 |
| 49 | ob_size=0.000 |
| 50 | ob_r=0.000 |
| 51 | ob_g=0.000 |
| 52 | ob_b=0.000 |
| 53 | ob_a=1.000 |
| 54 | ib_size=0.000 |
| 55 | ib_r=0.000 |
| 56 | ib_g=0.250 |
| 57 | ib_b=1.000 |
| 58 | ib_a=1.000 |
| 59 | nMotionVectorsX=64.000 |
| 60 | nMotionVectorsY=48.000 |
| 61 | mv_dx=0.000 |
| 62 | mv_dy=0.000 |
| 63 | mv_l=0.000 |
| 64 | mv_r=1.000 |
| 65 | mv_g=1.000 |
| 66 | mv_b=1.000 |
| 67 | mv_a=0.000 |
| 68 | b1n=0.000 |
| 69 | b2n=0.000 |
| 70 | b3n=0.000 |
| 71 | b1x=1.000 |
| 72 | b2x=1.000 |
| 73 | b3x=1.000 |
| 74 | b1ed=0.000 |
| 75 | wavecode_0_enabled=1 |
| 76 | wavecode_0_samples=512 |
| 77 | wavecode_0_sep=0 |
| 78 | wavecode_0_bSpectrum=0 |
| 79 | wavecode_0_bUseDots=0 |
| 80 | wavecode_0_bDrawThick=1 |
| 81 | wavecode_0_bAdditive=1 |
| 82 | wavecode_0_scaling=2.02310 |
| 83 | wavecode_0_smoothing=0.00000 |
| 84 | wavecode_0_r=0.180 |
| 85 | wavecode_0_g=1.000 |
| 86 | wavecode_0_b=1.000 |
| 87 | wavecode_0_a=1.000 |
| 88 | wave_0_init1=t2 = 0; |
| 89 | wave_0_init2=t3 = 0; |
| 90 | wave_0_init3=t4 = 0; |
| 91 | wave_0_init4=cl = 0; |
| 92 | wave_0_per_frame1=vol = bass*8 + mid*5 + treb*3; |
| 93 | wave_0_per_frame2=m = m*0.97 + vol*0.08; |
| 94 | wave_0_per_frame3=monitor = vol; |
| 95 | wave_0_per_frame4=beat = above(vol,res)*above(vol,m)*above(vol,16); |
| 96 | wave_0_per_frame5=diff = (1-beat)*diff + beat*(vol-res); |
| 97 | wave_0_per_frame6=res = beat*(vol + m*0.04) + (1-beat)*(res - (0.1+diff*0.02)*60/fps); |
| 98 | wave_0_per_frame7=res = max(0,res); |
| 99 | wave_0_per_frame8= |
| 100 | wave_0_per_frame9=a = beat; |
| 101 | wave_0_per_point1=tt3 = tt3*0.6 + (value1)*1; |
| 102 | wave_0_per_point2=tt2 = tt2*0.7 + tt3*0.2; |
| 103 | wave_0_per_point3=tt1 = tt1*0.8 + tt2*0.1; |
| 104 | wave_0_per_point4=d = d*0.9 + tt1*0.2; |
| 105 | wave_0_per_point5= |
| 106 | wave_0_per_point6=y = 0.5 + d*sample*(1-sample)*2; |
| 107 | wave_0_per_point7=x = -0.05 + sample*1.1; |
| 108 | wavecode_1_enabled=1 |
| 109 | wavecode_1_samples=512 |
| 110 | wavecode_1_sep=0 |
| 111 | wavecode_1_bSpectrum=1 |
| 112 | wavecode_1_bUseDots=0 |
| 113 | wavecode_1_bDrawThick=0 |
| 114 | wavecode_1_bAdditive=0 |
| 115 | wavecode_1_scaling=0.36971 |
| 116 | wavecode_1_smoothing=0.00000 |
| 117 | wavecode_1_r=0.010 |
| 118 | wavecode_1_g=1.000 |
| 119 | wavecode_1_b=1.000 |
| 120 | wavecode_1_a=1.000 |
| 121 | wave_1_init1=chance = 0; |
| 122 | wave_1_per_frame1=t1 = asin(1); |
| 123 | wave_1_per_frame2= |
| 124 | wave_1_per_frame3=rot = rot + q6; |
| 125 | wave_1_per_frame4=t2 = rot; |
| 126 | wave_1_per_frame5= |
| 127 | wave_1_per_frame6=q4 = 0.5 + (q4-0.5)*q15; |
| 128 | wave_1_per_frame7=q5 = 0.5 + (q5-0.5)*q15; |
| 129 | wave_1_per_point1=w = 4*t1*sample + t2; |
| 130 | wave_1_per_point2=d = q3*0.5*q15 + value1; |
| 131 | wave_1_per_point3= |
| 132 | wave_1_per_point4=x = q4 + sin(w)*d; |
| 133 | wave_1_per_point5=y = q5 + cos(w)*d; |
| 134 | wavecode_2_enabled=1 |
| 135 | wavecode_2_samples=512 |
| 136 | wavecode_2_sep=0 |
| 137 | wavecode_2_bSpectrum=1 |
| 138 | wavecode_2_bUseDots=0 |
| 139 | wavecode_2_bDrawThick=0 |
| 140 | wavecode_2_bAdditive=0 |
| 141 | wavecode_2_scaling=0.36971 |
| 142 | wavecode_2_smoothing=0.00000 |
| 143 | wavecode_2_r=0.010 |
| 144 | wavecode_2_g=1.000 |
| 145 | wavecode_2_b=1.000 |
| 146 | wavecode_2_a=1.000 |
| 147 | wave_2_init1=chance = 0; |
| 148 | wave_2_per_frame1=t1 = asin(1); |
| 149 | wave_2_per_frame2= |
| 150 | wave_2_per_frame3=rot = rot + q9; |
| 151 | wave_2_per_frame4=t2 = rot; |
| 152 | wave_2_per_frame5= |
| 153 | wave_2_per_frame6=q7 = 0.5 + (q7-0.5)*q15; |
| 154 | wave_2_per_frame7=q8 = 0.5 + (q8-0.5)*q15; |
| 155 | wave_2_per_point1=w = 4*t1*sample + t2; |
| 156 | wave_2_per_point2=d = q3*0.5*q15 + value1; |
| 157 | wave_2_per_point3= |
| 158 | wave_2_per_point4=x = q7 + sin(w)*d; |
| 159 | wave_2_per_point5=y = q8 + cos(w)*d; |
| 160 | wavecode_3_enabled=1 |
| 161 | wavecode_3_samples=512 |
| 162 | wavecode_3_sep=0 |
| 163 | wavecode_3_bSpectrum=1 |
| 164 | wavecode_3_bUseDots=0 |
| 165 | wavecode_3_bDrawThick=0 |
| 166 | wavecode_3_bAdditive=0 |
| 167 | wavecode_3_scaling=0.36971 |
| 168 | wavecode_3_smoothing=0.00000 |
| 169 | wavecode_3_r=0.010 |
| 170 | wavecode_3_g=1.000 |
| 171 | wavecode_3_b=1.000 |
| 172 | wavecode_3_a=1.000 |
| 173 | wave_3_init1=chance = 0; |
| 174 | wave_3_per_frame1=t1 = asin(1); |
| 175 | wave_3_per_frame2= |
| 176 | wave_3_per_frame3=rot = rot + q12; |
| 177 | wave_3_per_frame4=t2 = rot; |
| 178 | wave_3_per_frame5= |
| 179 | wave_3_per_frame6=q10 = 0.5 + (q10-0.5)*q15; |
| 180 | wave_3_per_frame7=q11= 0.5 + (q11-0.5)*q15; |
| 181 | wave_3_per_point1=w = 4*t1*sample + t2; |
| 182 | wave_3_per_point2=d = q3*0.5*q15 + value1; |
| 183 | wave_3_per_point3= |
| 184 | wave_3_per_point4=x = q10 + sin(w)*d; |
| 185 | wave_3_per_point5=y = q11 + cos(w)*d; |
| 186 | shapecode_0_enabled=0 |
| 187 | shapecode_0_sides=100 |
| 188 | shapecode_0_additive=1 |
| 189 | shapecode_0_thickOutline=1 |
| 190 | shapecode_0_textured=0 |
| 191 | shapecode_0_num_inst=1 |
| 192 | shapecode_0_x=0.500 |
| 193 | shapecode_0_y=0.500 |
| 194 | shapecode_0_rad=0.02770 |
| 195 | shapecode_0_ang=6.03186 |
| 196 | shapecode_0_tex_ang=6.03186 |
| 197 | shapecode_0_tex_zoom=0.68390 |
| 198 | shapecode_0_r=1.000 |
| 199 | shapecode_0_g=0.000 |
| 200 | shapecode_0_b=0.000 |
| 201 | shapecode_0_a=0.000 |
| 202 | shapecode_0_r2=1.000 |
| 203 | shapecode_0_g2=0.000 |
| 204 | shapecode_0_b2=0.000 |
| 205 | shapecode_0_a2=0.000 |
| 206 | shapecode_0_border_r=0.050 |
| 207 | shapecode_0_border_g=1.000 |
| 208 | shapecode_0_border_b=1.000 |
| 209 | shapecode_0_border_a=1.000 |
| 210 | shape_0_per_frame1=an = an + q6; |
| 211 | shape_0_per_frame2=ang = an*0.5; |
| 212 | shape_0_per_frame3=x = q4; |
| 213 | shape_0_per_frame4=y = q5; |
| 214 | shape_0_per_frame5=rad = q3; |
| 215 | shape_0_per_frame6= |
| 216 | shape_0_per_frame7= |
| 217 | shape_0_per_frame8=x = 0.5 + (x-0.5)/q2; |
| 218 | shape_0_per_frame9=y = 0.5 + (y-0.5)/q1; |
| 219 | shape_0_per_frame10= |
| 220 | shapecode_1_enabled=0 |
| 221 | shapecode_1_sides=100 |
| 222 | shapecode_1_additive=1 |
| 223 | shapecode_1_thickOutline=1 |
| 224 | shapecode_1_textured=0 |
| 225 | shapecode_1_num_inst=1 |
| 226 | shapecode_1_x=0.500 |
| 227 | shapecode_1_y=0.500 |
| 228 | shapecode_1_rad=0.02770 |
| 229 | shapecode_1_ang=6.03186 |
| 230 | shapecode_1_tex_ang=6.03186 |
| 231 | shapecode_1_tex_zoom=0.68390 |
| 232 | shapecode_1_r=1.000 |
| 233 | shapecode_1_g=0.000 |
| 234 | shapecode_1_b=0.000 |
| 235 | shapecode_1_a=0.000 |
| 236 | shapecode_1_r2=1.000 |
| 237 | shapecode_1_g2=0.000 |
| 238 | shapecode_1_b2=0.000 |
| 239 | shapecode_1_a2=0.000 |
| 240 | shapecode_1_border_r=0.050 |
| 241 | shapecode_1_border_g=1.000 |
| 242 | shapecode_1_border_b=1.000 |
| 243 | shapecode_1_border_a=1.000 |
| 244 | shape_1_per_frame1=an = an + q9; |
| 245 | shape_1_per_frame2=ang = an*0.5; |
| 246 | shape_1_per_frame3=x = q7; |
| 247 | shape_1_per_frame4=y = q8; |
| 248 | shape_1_per_frame5=rad = q3; |
| 249 | shape_1_per_frame6= |
| 250 | shape_1_per_frame7=x = 0.5 + (x-0.5)/q2; |
| 251 | shape_1_per_frame8=y = 0.5 + (y-0.5)/q1; |
| 252 | shape_1_per_frame9= |
| 253 | shapecode_2_enabled=0 |
| 254 | shapecode_2_sides=100 |
| 255 | shapecode_2_additive=1 |
| 256 | shapecode_2_thickOutline=1 |
| 257 | shapecode_2_textured=0 |
| 258 | shapecode_2_num_inst=1 |
| 259 | shapecode_2_x=0.500 |
| 260 | shapecode_2_y=0.500 |
| 261 | shapecode_2_rad=0.02770 |
| 262 | shapecode_2_ang=6.03186 |
| 263 | shapecode_2_tex_ang=6.03186 |
| 264 | shapecode_2_tex_zoom=0.68390 |
| 265 | shapecode_2_r=1.000 |
| 266 | shapecode_2_g=0.000 |
| 267 | shapecode_2_b=0.000 |
| 268 | shapecode_2_a=0.000 |
| 269 | shapecode_2_r2=1.000 |
| 270 | shapecode_2_g2=0.000 |
| 271 | shapecode_2_b2=0.000 |
| 272 | shapecode_2_a2=0.000 |
| 273 | shapecode_2_border_r=0.050 |
| 274 | shapecode_2_border_g=1.000 |
| 275 | shapecode_2_border_b=1.000 |
| 276 | shapecode_2_border_a=1.000 |
| 277 | shape_2_per_frame1=an = an + q12; |
| 278 | shape_2_per_frame2=ang = an*0.5; |
| 279 | shape_2_per_frame3=x = q10; |
| 280 | shape_2_per_frame4=y = q11; |
| 281 | shape_2_per_frame5=rad = q3; |
| 282 | shape_2_per_frame6= |
| 283 | shape_2_per_frame7=x = 0.5 + (x-0.5)/q2; |
| 284 | shape_2_per_frame8=y = 0.5 + (y-0.5)/q1; |
| 285 | shape_2_per_frame9= |
| 286 | shapecode_3_enabled=0 |
| 287 | shapecode_3_sides=48 |
| 288 | shapecode_3_additive=1 |
| 289 | shapecode_3_thickOutline=0 |
| 290 | shapecode_3_textured=0 |
| 291 | shapecode_3_num_inst=4 |
| 292 | shapecode_3_x=0.500 |
| 293 | shapecode_3_y=0.500 |
| 294 | shapecode_3_rad=0.02770 |
| 295 | shapecode_3_ang=6.03186 |
| 296 | shapecode_3_tex_ang=6.03186 |
| 297 | shapecode_3_tex_zoom=0.68390 |
| 298 | shapecode_3_r=1.000 |
| 299 | shapecode_3_g=1.000 |
| 300 | shapecode_3_b=1.000 |
| 301 | shapecode_3_a=1.000 |
| 302 | shapecode_3_r2=1.000 |
| 303 | shapecode_3_g2=1.000 |
| 304 | shapecode_3_b2=1.000 |
| 305 | shapecode_3_a2=1.000 |
| 306 | shapecode_3_border_r=0.000 |
| 307 | shapecode_3_border_g=0.000 |
| 308 | shapecode_3_border_b=0.000 |
| 309 | shapecode_3_border_a=1.000 |
| 310 | shape_3_per_frame1=an = an + 0.5*q16/num_inst; |
| 311 | shape_3_per_frame2=w = asin(1)*4*instance/num_inst + an; |
| 312 | shape_3_per_frame3=x = q6 + sin(w)*q5*0.5; |
| 313 | shape_3_per_frame4=y = q7 + cos(w)*q5*0.5; |
| 314 | shape_3_per_frame5=rad = q5*0.25; |
| 315 | shape_3_per_frame6= |
| 316 | shape_3_per_frame7= |
| 317 | shape_3_per_frame8=//x = 0.5 + (x-0.5)/q2; |
| 318 | shape_3_per_frame9=//y = 0.5 + (y-0.5)/q1; |
| 319 | shape_3_per_frame10= |
| 320 | per_frame_init_1=x1 = 0.5; |
| 321 | per_frame_init_2=y1 = 0.6; |
| 322 | per_frame_init_3= |
| 323 | per_frame_init_4=x2 = 0.5; |
| 324 | per_frame_init_5=y2 = 0.4; |
| 325 | per_frame_init_6= |
| 326 | per_frame_init_7=x3 = 0.5; |
| 327 | per_frame_init_8=y3 = 0.2; |
| 328 | per_frame_init_9= |
| 329 | per_frame_init_10=vr1 = 0.0001; |
| 330 | per_frame_init_11=vr2 = 0.0; |
| 331 | per_frame_init_12=vr3 = 0.0; |
| 332 | per_frame_init_13= |
| 333 | per_frame_init_14=vx1 = 0; |
| 334 | per_frame_init_15=vx2 = 0; |
| 335 | per_frame_init_16=vx3 = 0; |
| 336 | per_frame_1=zoom = 1; |
| 337 | per_frame_2=wave_a = 0; |
| 338 | per_frame_3= |
| 339 | per_frame_4=// impuls transmission with an angular momentum factor, 3 bodies |
| 340 | per_frame_5=// code by Flexi |
| 341 | per_frame_6=// good luck with tuning these values to a fine dynamic behavior ;-) |
| 342 | per_frame_7= |
| 343 | per_frame_8= r = 0.11+ (bass_att+treb_att)*0.005; // the object's radius |
| 344 | per_frame_9= |
| 345 | per_frame_10= gravity = 0.01; |
| 346 | per_frame_11= |
| 347 | per_frame_12= bouncedampening = 0.94; // This is where kinetic energy is taken from the system. |
| 348 | per_frame_13= // Be careful with values close to 1.0 |
| 349 | per_frame_14= |
| 350 | per_frame_15= bounceimpact = 0.17; // When an object hits one border, it slightly penetrates it. |
| 351 | per_frame_16= // The impact value determines how strong this depth is taken as resulting impuls. |
| 352 | per_frame_17= // This is where kinetic energy possibly is added to the system depent on the increase in size. |
| 353 | per_frame_18= |
| 354 | per_frame_19=// don't change below |
| 355 | per_frame_20= |
| 356 | per_frame_21=// bouncing off borders (the first rotating object) |
| 357 | per_frame_22= |
| 358 | per_frame_23= y1 = y1+vy1; // adding velocity vector to position |
| 359 | per_frame_24= x1 = x1+vx1; |
| 360 | per_frame_25= |
| 361 | per_frame_26= vr = sin(vr1)*r; // tangential velocity |
| 362 | per_frame_27=bounce = below(y1,r-(aspectx-1)*0.5); // hit floor? |
| 363 | per_frame_28= vy1 = if(bounce, abs(vy1)*bouncedampening + (r-y1-(aspectx-1)*0.5)*bounceimpact, vy1-gravity/fps); |
| 364 | per_frame_29= vx1 = if(bounce, vx1 + (vr-vx1)*bounceimpact, vx1); |
| 365 | per_frame_30= vr = if(bounce, vr + (vx1-vr)*0.85 , vr); |
| 366 | per_frame_31=bounce = above(x1,1-r+(aspecty-1)*0.5); // hit right border? |
| 367 | per_frame_32= vx1 = if(bounce, - abs(vx1)*bouncedampening + (1-r-x1+(aspecty-1)*0.5)*bounceimpact, vx1); |
| 368 | per_frame_33= vy1 = if(bounce, vy1 + (vr-vy1)*bounceimpact, vy1); |
| 369 | per_frame_34= vr = if(bounce, vr + (vy1-vr)*0.85 , vr); |
| 370 | per_frame_35=bounce = below(x1,r-(aspecty-1)*0.5); // hit left border? |
| 371 | per_frame_36= vx1 = if(bounce, abs(vx1)*bouncedampening + (r-x1-(aspecty-1)*0.5)*bounceimpact, vx1); |
| 372 | per_frame_37= vy1 = if(bounce, vy1 + (-vr-vy1)*bounceimpact, vy1); |
| 373 | per_frame_38= vr = if(bounce, vr - (vy1+vr)*0.85 , vr); |
| 374 | per_frame_39= vr1 = asin(vr/r); // angular velocity of the surface |
| 375 | per_frame_40= |
| 376 | per_frame_41=// bouncing off borders (the second rotating object) |
| 377 | per_frame_42=vr=sin(vr2)*r;bounce=below(y2,r-(aspectx-1)*0.5);y2=y2+vy2;vy2=if(bounce,abs(vy2)*bouncedampening+(r-y2-(aspectx-1)*0.5) |
| 378 | per_frame_43=*bounceimpact,vy2-gravity/fps);vx2=if(bounce,vx2+(vr-vx2)*bounceimpact,vx2);vr=if(bounce,vr+(vx2-vr)*0.85,vr); |
| 379 | per_frame_44=bounce=above(x2,1-r+(aspecty-1)*0.5);vx2=if(bounce,-abs(vx2)*bouncedampening+(1-r-x2+(aspecty-1)*0.5)*bounceimpact,vx2); |
| 380 | per_frame_45=vy2=if(bounce,vy2+(vr-vy2)*bounceimpact,vy2);vr=if(bounce,vr+(vy2-vr)*0.85,vr);bounce=below(x2,r-(aspecty-1)*0.5);x2=x2+vx2; |
| 381 | per_frame_46=vx2=if(bounce,abs(vx2)*bouncedampening+(r-x2-(aspecty-1)*0.5)*bounceimpact,vx2);vy2=if(bounce,vy2+(-vr-vy2)*bounceimpact,vy2); |
| 382 | per_frame_47=vr=if(bounce,vr-(vy2+vr)*0.85,vr);vr2=asin(vr/r); |
| 383 | per_frame_48= |
| 384 | per_frame_49=// bouncing off borders (the third rotating object) |
| 385 | per_frame_50=vr=sin(vr3)*r;bounce=below(y3,r-(aspectx-1)*0.5);y3=y3+vy3;vy3=if(bounce,abs(vy3)*bouncedampening+(r-y3-(aspectx-1)*0.5) |
| 386 | per_frame_51=*bounceimpact,vy3-gravity/fps);vx3=if(bounce,vx3+(vr-vx3)*bounceimpact,vx3);vr=if(bounce,vr+(vx3-vr)*0.85,vr); |
| 387 | per_frame_52=bounce=above(x3,1-r+(aspecty-1)*0.5);vx3=if(bounce,-abs(vx3)*bouncedampening+(1-r-x3+(aspecty-1)*0.5)*bounceimpact,vx3); |
| 388 | per_frame_53=vy3=if(bounce,vy3+(vr-vy3)*bounceimpact,vy3);vr=if(bounce,vr+(vy3-vr)*0.85,vr);bounce=below(x3,r-(aspecty-1)*0.5);x3=x3+vx3; |
| 389 | per_frame_54=vx3=if(bounce,abs(vx3)*bouncedampening+(r-x3-(aspecty-1)*0.5)*bounceimpact,vx3);vy3=if(bounce,vy3+(-vr-vy3)*bounceimpact,vy3); |
| 390 | per_frame_55=vr=if(bounce,vr-(vy3+vr)*0.85,vr);vr3=asin(vr/r); |
| 391 | per_frame_56= |
| 392 | per_frame_57=// bouncing of object1 with object2 |
| 393 | per_frame_58= |
| 394 | per_frame_59=bounce = below( sqrt( sqr(x1+vx1-x2-vx2) + sqr(y1+vy1-y2-vy2)), 2*r); // is distance < diameter ? |
| 395 | per_frame_60=bounce = bounce*below(sqrt( sqr(x1+vx1-x2-vx2) + sqr(y1+vy1-y2-vy2)),sqrt( sqr(x1-x2) + sqr(y1-y2))); // detect only if objects |
| 396 | per_frame_61= // move towards each other |
| 397 | per_frame_62=ref_ang = atan2(x2-x1,y2-y1)+asin(1); // angle of the common tangent |
| 398 | per_frame_63=v1 = sqrt(vx1*vx1+vy1*vy1); // absolute velocity |
| 399 | per_frame_64=v2 = sqrt(vx2*vx2+vy2*vy2); |
| 400 | per_frame_65=w1 = atan2(vx1,vy1); // absolute motion angle |
| 401 | per_frame_66=w2 = atan2(vx2,vy2); |
| 402 | per_frame_67=vr = sin(vr1)*r; // angular velocity of the surface |
| 403 | per_frame_68=v2r= sin(vr2)*r; |
| 404 | per_frame_69=// in case of a bounce, the velocity is split into the horizontal and vertical part relative to the common tangent, |
| 405 | per_frame_70=// then the vertical aspects get swapped. |
| 406 | per_frame_71=// a bounce goes 90% into impuls transmission and 10% angular momentum transmission. |
| 407 | per_frame_72=// these values make quite a plausible impression, but in fact this has pretty little to do with physical correctness ;) |
| 408 | per_frame_73=vx1 = if(bounce,sin(ref_ang)*v1*cos(w1-ref_ang) + ((vr-v2r)-sin(ref_ang)*v1*cos(w1-ref_ang))*0.1 |
| 409 | per_frame_74= + sin(ref_ang+asin(1))*v2*cos(w2-ref_ang-asin(1)), vx1); |
| 410 | per_frame_75=vy1 = if(bounce,cos(ref_ang)*v1*cos(w1-ref_ang) + ((vr-v2r)-cos(ref_ang)*v1*cos(w1-ref_ang))*0.1 |
| 411 | per_frame_76= + cos(ref_ang+asin(1))*v2*cos(w2-ref_ang-asin(1)), vy1); |
| 412 | per_frame_77=vx2 = if(bounce,sin(ref_ang)*v2*cos(w2-ref_ang) + ((v2r-vr)-sin(ref_ang)*v2*cos(w2-ref_ang))*0.1 |
| 413 | per_frame_78= + sin(ref_ang+asin(1))*v1*cos(w1-ref_ang-asin(1)), vx2); |
| 414 | per_frame_79=vy2 = if(bounce,cos(ref_ang)*v2*cos(w2-ref_ang) + ((v2r-vr)-cos(ref_ang)*v2*cos(w2-ref_ang))*0.1 |
| 415 | per_frame_80= + cos(ref_ang+asin(1))*v1*cos(w1-ref_ang-asin(1)), vy2); |
| 416 | per_frame_81=vr = if(bounce, vr + (cos(w1-ref_ang)*(v1-v2)-vr)*0.9 , vr); |
| 417 | per_frame_82=vr1 = asin(vr/r); |
| 418 | per_frame_83=v2r = if(bounce, v2r + (cos(w2-ref_ang)*(v2-v1)-v2r)*0.9 , v2r); |
| 419 | per_frame_84=vr2 = asin(v2r/r); |
| 420 | per_frame_85= |
| 421 | per_frame_86=// bouncing of object1 with object3 |
| 422 | per_frame_87= |
| 423 | per_frame_88= |
| 424 | per_frame_89=bounce=below(sqrt(sqr(x1+vx1-x3-vx3)+sqr(y1+vy1-y3-vy3)),2*r);bounce=bounce*below(sqrt(sqr(x1+vx1-x3- |
| 425 | per_frame_90=vx3)+sqr(y1+vy1-y3-vy3)),sqrt(sqr(x1-x3)+sqr(y1-y3)));ref_ang=atan2(x3-x1,y3-y1)+asin(1);v1=sqrt(vx1*vx1 |
| 426 | per_frame_91=+vy1*vy1);v2=sqrt(vx3*vx3+vy3*vy3);w1=atan2(vx1,vy1);w2=atan2(vx3,vy3);vr=sin(vr1)*r;v2r=sin(vr3)*r;vx1 |
| 427 | per_frame_92==if(bounce,sin(ref_ang)*v1*cos(w1-ref_ang)+((vr-v2r)-sin(ref_ang)*v1*cos(w1-ref_ang))*0.1+sin(ref_ang+ |
| 428 | per_frame_93=asin(1))*v2*cos(w2-ref_ang-asin(1)),vx1);vy1=if(bounce,cos(ref_ang)*v1*cos(w1-ref_ang)+((vr-v2r)-cos |
| 429 | per_frame_94=(ref_ang)*v1*cos(w1-ref_ang))*0.1+cos(ref_ang+asin(1))*v2*cos(w2-ref_ang-asin(1)),vy1);vx3=if(bounce,sin |
| 430 | per_frame_95=(ref_ang)*v2*cos(w2-ref_ang)+((v2r-vr)-sin(ref_ang)*v2*cos(w2-ref_ang))*0.1+sin(ref_ang+asin(1))*v1*cos |
| 431 | per_frame_96=(w1-ref_ang-asin(1)),vx3);vy3=if(bounce,cos(ref_ang)*v2*cos(w2-ref_ang)+((v2r-vr)-cos(ref_ang)*v2*cos(w2 |
| 432 | per_frame_97=-ref_ang))*0.1+cos(ref_ang+asin(1))*v1*cos(w1-ref_ang-asin(1)),vy3);vr=if(bounce,vr+(cos(w1-ref_ang)*(v1 |
| 433 | per_frame_98=-v2)-vr)*0.9,vr);vr1=asin(vr/r);v2r=if(bounce,v2r+(cos(w2-ref_ang)*(v2-v1)-v2r)*0.9,v2r);vr3=asin(v2r/r); |
| 434 | per_frame_99= |
| 435 | per_frame_100=// bouncing of object3 with object2 |
| 436 | per_frame_101=bounce=below(sqrt(sqr(x3+vx3-x2-vx2)+sqr(y3+vy3-y2-vy2)),2*r);bounce=bounce*below(sqrt(sqr(x2+vx2-x3- |
| 437 | per_frame_102=vx3)+sqr(y2+vy2-y3-vy3)),sqrt(sqr(x2-x3)+sqr(y2-y3)));ref_ang=atan2(x2-x3,y2-y3)+asin(1);v1=sqrt(vx3*vx3 |
| 438 | per_frame_103=+vy3*vy3);v2=sqrt(vx2*vx2+vy2*vy2);w1=atan2(vx3,vy3);w2=atan2(vx2,vy2);vr=sin(vr3)*r;v2r=sin(vr2)*r;vx3 |
| 439 | per_frame_104==if(bounce,sin(ref_ang)*v1*cos(w1-ref_ang)+((vr-v2r)-sin(ref_ang)*v1*cos(w1-ref_ang))*0.1+sin(ref_ang+ |
| 440 | per_frame_105=asin(1))*v2*cos(w2-ref_ang-asin(1)),vx3);vy3=if(bounce,cos(ref_ang)*v1*cos(w1-ref_ang)+((vr-v2r)-cos |
| 441 | per_frame_106=(ref_ang)*v1*cos(w1-ref_ang))*0.1+cos(ref_ang+asin(1))*v2*cos(w2-ref_ang-asin(1)),vy3);vx2=if(bounce,sin |
| 442 | per_frame_107=(ref_ang)*v2*cos(w2-ref_ang)+((v2r-vr)-sin(ref_ang)*v2*cos(w2-ref_ang))*0.1+sin(ref_ang+asin(1))*v1*cos |
| 443 | per_frame_108=(w1-ref_ang-asin(1)),vx2);vy2=if(bounce,cos(ref_ang)*v2*cos(w2-ref_ang)+((v2r-vr)-cos(ref_ang)*v2*cos(w2 |
| 444 | per_frame_109=-ref_ang))*0.1+cos(ref_ang+asin(1))*v1*cos(w1-ref_ang-asin(1)),vy2);vr=if(bounce,vr+(cos(w1-ref_ang)*(v1 |
| 445 | per_frame_110=-v2)-vr)*0.9,vr);vr3=asin(vr/r);v2r=if(bounce,v2r+(cos(w2-ref_ang)*(v2-v1)-v2r)*0.9,v2r);vr2=asin(v2r/r); |
| 446 | per_frame_111= |
| 447 | per_frame_112= |
| 448 | per_frame_113=q1 = aspectx; |
| 449 | per_frame_114=q2 = aspecty; |
| 450 | per_frame_115=q3 = r*2; |
| 451 | per_frame_116= |
| 452 | per_frame_117=q4 = x1; q5 = y1; q6 = vr1; |
| 453 | per_frame_118=q7 = x2; q8 = y2; q9 = vr2; |
| 454 | per_frame_119=q10 = x3; q11 = y3; q12 = vr3; |
| 455 | per_frame_120=q13 = atan2( (x1+x2+x3)/3 - 0.5, (y1+y2+y3)/3-0.5); |
| 456 | per_frame_121=q14 = sigmoid(sqrt( sqr((x1+x2+x3)/3 - 0.5) + sqr((y1+y2+y3)/3-0.5) ),2)*0.2; |
| 457 | per_frame_122=q15 = 1/max(aspectx,aspecty); |
| 458 | per_pixel_1=c = 42; // impacts the "sharpness" of the sigmoid filter function |
| 459 | per_pixel_2=s = 0.5; // strength of the rotation |
| 460 | per_pixel_3=d = q3*0.6; // radius of the sigmoid filter function |
| 461 | per_pixel_4= |
| 462 | per_pixel_5=// |
| 463 | per_pixel_6=cx1 = 0.5 + (q4-0.5)*q15; |
| 464 | per_pixel_7=cy1 = 0.5 - (q5-0.5)*q15; |
| 465 | per_pixel_8=d1 = sqrt( sqr(x-cx1) + sqr(y-cy1)); |
| 466 | per_pixel_9=s1 = sigmoid(d-d1,c)*s; |
| 467 | per_pixel_10=rx1 = -q6*sin(y-cy1)*s1; |
| 468 | per_pixel_11=ry1 = q6*sin(x-cx1)*s1; |
| 469 | per_pixel_12= |
| 470 | per_pixel_13=cx2 = 0.5 + (q7-0.5)*q15; |
| 471 | per_pixel_14=cy2 = 0.5 - (q8-0.5)*q15; |
| 472 | per_pixel_15=d2 = sqrt( sqr(x-cx2) + sqr(y-cy2)); |
| 473 | per_pixel_16=s2 = sigmoid(d-d2,c)*s; |
| 474 | per_pixel_17=rx2 = -q9*sin(y-cy2)*s2; |
| 475 | per_pixel_18=ry2 = q9*sin(x-cx2)*s2; |
| 476 | per_pixel_19= |
| 477 | per_pixel_20=cx3 = 0.5 + (q10-0.5)*q15; |
| 478 | per_pixel_21=cy3 = 0.5 - (q11-0.5)*q15; |
| 479 | per_pixel_22=d3 = sqrt( sqr(x-cx3) + sqr(y-cy3)); |
| 480 | per_pixel_23=s3 = sigmoid(0.12-d3,c)*s; |
| 481 | per_pixel_24=rx3 = -q12*sin(y-cy3)*s3; |
| 482 | per_pixel_25=ry3 = q12*sin(x-cx3)*s3; |
| 483 | per_pixel_26= |
| 484 | per_pixel_27= |
| 485 | per_pixel_28= |
| 486 | per_pixel_29=dx = rx1 + rx2 + rx3; |
| 487 | per_pixel_30=dy = ry1 + ry2 + ry3; |
| 488 | per_pixel_31= |
| 489 | warp_1=`shader_body |
| 490 | warp_2=`{ |
| 491 | warp_3=` |
| 492 | warp_4=` float1 d = 0.01; |
| 493 | warp_5=` float3 dx = ( 2*GetBlur2(uv + float2(d,0)) - 2*GetBlur2(uv-float2(d,0)) )*1280*texsize.z*0.5; |
| 494 | warp_6=` float3 dy = ( 2*GetBlur2(uv + float2(0,d)) - 2*GetBlur2(uv-float2(0,d)) )*1024*texsize.w*0.5; |
| 495 | warp_7=` |
| 496 | warp_8=` float2 my_uv = uv - (+float2(dx.y,dy.y)*0.3 + float2(dx.x,dy.x)*0.1 + float2(dy.y,-dx.y)*0.01)*0.01; |
| 497 | warp_9=` ret.x = tex2D( sampler_fw_main, my_uv-floor(my_uv)).x; |
| 498 | warp_10=` ret.x += (2*ret.x - 2*GetBlur1(my_uv).x)*.25 +0.0; |
| 499 | warp_11=` |
| 500 | warp_12=` |
| 501 | warp_13=` my_uv = uv - float2(dx.y,dy.y)*0.01 + float2(dy.x,-dx.y)*0.001; |
| 502 | warp_14=` ret.y = tex2D( sampler_fw_main, my_uv-floor(my_uv)).y; |
| 503 | warp_15=` ret.y += (2*ret.y - 2*GetBlur3(my_uv).y)*.025 +0.01; |
| 504 | warp_16=` |
| 505 | warp_17=`} |
| 506 | comp_1=`shader_body |
| 507 | comp_2=`{ |
| 508 | comp_3=` float2 d = texsize.zw*4; |
| 509 | comp_4=` float3 dx = ( 2*GetBlur1(saturate(0.5 + (uv-0.5)+float2(q19,q20)*float2(-1,1))+float2(1,0)*d)-2*GetBlur1(saturate(0.5 + (uv-0.5)+float2(q19,q20)*float2(-1,1))-float2(1,0)*d) )*0.5; |
| 510 | comp_5=` float3 dy = ( 2*GetBlur1(saturate(0.5 + (uv-0.5)+float2(q19,q20)*float2(-1,1))+float2(0,1)*d)-2*GetBlur1(saturate(0.5 + (uv-0.5)+float2(q19,q20)*float2(-1,1))-float2(0,1)*d) )*0.5; |
| 511 | comp_6=` |
| 512 | comp_7=`float2 uv_x = saturate(0.5 + (uv-0.5)+float2(q19,q20)*float2(-1,1))-float2(dx.x,dy.x)*texsize.zw*4 + float2(dx.y,dy.y)*texsize.zw*32; |
| 513 | comp_8=`ret = lerp(GetBlur2(saturate(0.5 + (uv-0.5)+float2(q19,q20)*float2(-1,1))).x,GetBlur3(saturate(0.5 + (uv-0.5)+float2(q19,q20)*float2(-1,1))).x,0.6) + (GetPixel(uv_x).x-GetBlur1(uv_x).x)*1*0; |
| 514 | comp_9=`ret =sqrt(ret); |
| 515 | comp_10=`ret = 1- ret; |
| 516 | comp_11=`ret *= lerp(float3(2,1,0),float3(0.5,1,2),(uv.x+uv.y)*0.5); |
| 517 | comp_12=`ret = lerp(ret,float3(2,1,0),GetBlur2(uv + float2(dx.y,dy.y)*0.1).y*2); |
| 518 | comp_13=`ret = lerp(ret,length(float2(dx.x,dy.x)) + GetPixel(saturate(0.5 + (uv-0.5)+float2(q19,q20)*float2(-1,1))).x,GetBlur1(uv).y*1.2); |
| 519 | comp_14=` |
| 520 | comp_15=`ret = lerp(ret,float3(1,1,2),-GetPixel(uv).z+saturate(GetPixel(uv).y*1.4-0.9)*1.2); |
| 521 | comp_16=`} |